<div class="container-fluid">
	<a class="brand" href="/admin">
		VCT
    </a>

<?php
    $xhtmlMenu = array();
    foreach ($this->navigation()->getContainer() as $mTop) {
        if(!$mTop->isVisible()) { continue; } // Skip on invisible

        if($mTop->hasPages()) {
            $xhtmlSub = array();
            foreach($mTop->getPages() as $mSub) {
                if(!$mSub->isVisible()) { continue; } // Skip on invisible

                $xhtmlPages = '';
                foreach($mSub->getPages() as $mPage) {
                    if(!$mPage->isVisible()) { continue; } // Skip on invisible

                    $xhtmlPages .= '<li><a href="' . $mPage->getHref() . '">' . $this->htmlUnquote($mPage->getLabel()) . '</a></li>';
                }
                $xhtmlSub []= '<li class="nav-header">' . $this->htmlUnquote($mSub->getLabel()) . '</li>'
                              . $xhtmlPages;
            }
            $xhtmlSub  = implode('<li class="divider"></li>', $xhtmlSub);
            $xhtmlMenu []= '<li class="dropdown">
            			       <a href="##" class="dropdown-toggle" data-toggle="dropdown">'
            			           . $this->htmlUnquote($mTop->getLabel()) .
            			           '&nbsp;<b class="caret"></b>
        			           </a>
        			           <ul class="dropdown-menu">'
			                       . $xhtmlSub .
			                   '</ul>
                           </li>';
        } else {
            // Just top - no sub
            $xhtmlMenu []= '<li><a href="' . $mTop->getHref() . '">' . $this->htmlUnquote($mTop->getLabel()) . '</a></li>';
        }
    }
    if($xhtmlMenu) {
        $xhtmlMenu = implode('<li class="divider-vertical"></li>', $xhtmlMenu);
        $xhtmlMenu = '<ul class="nav">' . $xhtmlMenu . '</ul>';
    }
    if (is_string($xhtmlMenu)) {
	    echo $xhtmlMenu;
    }
?>

	<p class="pull-right">
		<a href="/system/auth" class="profilecp" title="Cá nhân">Cá nhân</a>
		<a href="/system/auth/logout" class="logout" title="Thoát">Thoát</a>
    </p>
</div>
<style>
.navbar .divider-vertical {
	height: 40px;
	width: 1px;
	margin: 0px;
	overflow: hidden;
	background-color: #222;
	border-right: 1px solid #333;
}
</style>